# -*- coding: utf-8 -*-
from app import factory


def run(run_type=None):
    if run_type == 'DEVELOPMENT':
        flask_app = factory.create_app(config_name='DEVELOPMENT')
        return flask_app
    elif run_type == 'TESTING':
        flask_app = factory.create_app(config_name='TESTING')
        return flask_app
    elif run_type == 'PRODUCTION':
        flask_app = factory.create_app(config_name='PRODUCTION')
        return flask_app
    else:
        flask_app = factory.create_app(config_name='DEVELOPMENT')
        return flask_app


if __name__ == "__main__":
    app = run()
#    app.run()
    app.run(host='0.0.0.0', port=8012,
            threaded=2)  #
